package com.kgc.chapter01.vars

object Left_Right {
  def main(args: Array[String]): Unit = {

    haha(100,2 ) match {
      case Left(a) => println("有问题" + a)
      case Right(d) => println("正常" + d)
    }
  }

  def haha(x :Int ,y : Int) : Either[String,Int] =if (y == 0) Left("This is miss") else Right(x/y)

}
